// Copyright © 2023 ycq_work@163.com. All rights reserved.

/**
 * @Author: ycq_work@163.com
 * @DATE: 2023/10/17
 * @Description: 
*/

#include "OnlineMusic.h"
OnlineMusic::OnlineMusic(QWidget *parent) :
    QWidget(parent)
{
    this->init();
}
void OnlineMusic::init()
{
    this->setMinimumWidth(700);
    this->setAttribute(Qt::WA_StyledBackground, true);  // 启用样式表对窗口背景的控制

    QFont font("Microsoft YaHei", 10);              // 创建字体，指定字体名称和字体大小
    // 设置样式表，包括背景颜色
    QString styleSheet = "background-color: #A0A083;"
                         "border-radius: 7px;";
    this->setStyleSheet(styleSheet);

    // 创建控件
    auto* onlineMusicLabel = new QLabel;
    onlineMusicLabel->setFont(font);
    onlineMusicLabel->setText(tr("在线音乐"));

    // 创建布局
    auto *layout = new QVBoxLayout;
    layout->addWidget(onlineMusicLabel);

    // 添加一个竖直方向的额弹簧
    auto *spacer = new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding);
    layout->addItem(spacer);
    // 设置布局
    this->setLayout(layout);
}
